package com.salton123.whiteboard.model.record

import android.graphics.Canvas
import android.graphics.Matrix
import android.graphics.Paint
import com.salton123.whiteboard.Constant
import com.salton123.whiteboard.model.bean.SvgPath

/**
 * User: wujinsheng1@yy.com
 * Date: 2020/5/22 11:38
 * ModifyTime: 11:38
 * Description:每个操作代表一个动作，可以具体是画某个东西，也可以具体是某个动作
 */
abstract class IRecord {
    var paint: Paint = Paint()
    var path: SvgPath = SvgPath()
    var matrix: Matrix = Matrix()
    var strokeColor: Int = Constant.DEFAULT_DEFAULT_STROKE_COLOR
    var strokeSize: Float = Constant.DEFAULT_STROKE_SIZE
    var strokeAlpha: Int = Constant.DEFAULT_STROKE_ALPHA
    open fun draw(canvas: Canvas) {
        canvas.matrix = matrix
        canvas.drawPath(path, paint)
    }
}